3.1.2 \(\int (a+a \sin (c+d x)) \tan ^3(c+d x) \, dx\) [2]

Optimal. Leaf size=71 \[ \frac {5 a \log (1-\sin (c+d x))}{4 d}-\frac {a \log (1+\sin (c+d x))}{4 d}+\frac {a \sin (c+d x)}{d}+\frac {a^2}{2 d (a-a \sin (c+d x))} \]

[Out]

5/4*a*ln(1-sin(d*x+c))/d-1/4*a*ln(1+sin(d*x+c))/d+a*sin(d*x+c)/d+1/2*a^2/d/(a-a*sin(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {2786, 90} \begin {gather*} \frac {a^2}{2 d (a-a \sin (c+d x))}+\frac {a \sin (c+d x)}{d}+\frac {5 a \log (1-\sin (c+d x))}{4 d}-\frac {a \log (\sin (c+d x)+1)}{4 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + a*Sin[c + d*x])*Tan[c + d*x]^3,x]

[Out]

(5*a*Log[1 - Sin[c + d*x]])/(4*d) - (a*Log[1 + Sin[c + d*x]])/(4*d) + (a*Sin[c + d*x])/d + a^2/(2*d*(a - a*Sin
[c + d*x]))

Rule 90

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 2786

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[x^p*((a + x)^(m - (p + 1)/2)/(a - x)^((p + 1)/2)), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& EqQ[a^2 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

\begin {align*} \int (a+a \sin (c+d x)) \tan ^3(c+d x) \, dx &=\frac {\text {Subst}\left (\int \frac {x^3}{(a-x)^2 (a+x)} \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (1+\frac {a^2}{2 (a-x)^2}-\frac {5 a}{4 (a-x)}-\frac {a}{4 (a+x)}\right ) \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac {5 a \log (1-\sin (c+d x))}{4 d}-\frac {a \log (1+\sin (c+d x))}{4 d}+\frac {a \sin (c+d x)}{d}+\frac {a^2}{2 d (a-a \sin (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 77, normalized size = 1.08 \begin {gather*} -\frac {a \sin (c+d x) \tan ^2(c+d x)}{d}-\frac {3 a \left (\tanh ^{-1}(\sin (c+d x))-\sec (c+d x) \tan (c+d x)\right )}{2 d}+\frac {a \left (2 \log (\cos (c+d x))+\tan ^2(c+d x)\right )}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sin[c + d*x])*Tan[c + d*x]^3,x]

[Out]

-((a*Sin[c + d*x]*Tan[c + d*x]^2)/d) - (3*a*(ArcTanh[Sin[c + d*x]] - Sec[c + d*x]*Tan[c + d*x]))/(2*d) + (a*(2
*Log[Cos[c + d*x]] + Tan[c + d*x]^2))/(2*d)

________________________________________________________________________________________

Maple [A]
time = 0.14, size = 81, normalized size = 1.14

method result size
derivativedivides \(\frac {a \left (\frac {\sin ^{5}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) \(81\)
default \(\frac {a \left (\frac {\sin ^{5}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) \(81\)
risch \(-i a x -\frac {i a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {2 i a c}{d}-\frac {i a \,{\mathrm e}^{i \left (d x +c \right )}}{\left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{2} d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}+\frac {5 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}\) \(115\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sin(d*x+c))*tan(d*x+c)^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(1/2*sin(d*x+c)^5/cos(d*x+c)^2+1/2*sin(d*x+c)^3+3/2*sin(d*x+c)-3/2*ln(sec(d*x+c)+tan(d*x+c)))+a*(1/2*ta
n(d*x+c)^2+ln(cos(d*x+c))))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 51, normalized size = 0.72 \begin {gather*} -\frac {a \log \left (\sin \left (d x + c\right ) + 1\right ) - 5 \, a \log \left (\sin \left (d x + c\right ) - 1\right ) - 4 \, a \sin \left (d x + c\right ) + \frac {2 \, a}{\sin \left (d x + c\right ) - 1}}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))*tan(d*x+c)^3,x, algorithm="maxima")

[Out]

-1/4*(a*log(sin(d*x + c) + 1) - 5*a*log(sin(d*x + c) - 1) - 4*a*sin(d*x + c) + 2*a/(sin(d*x + c) - 1))/d

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 87, normalized size = 1.23 \begin {gather*} -\frac {4 \, a \cos \left (d x + c\right )^{2} + {\left (a \sin \left (d x + c\right ) - a\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 5 \, {\left (a \sin \left (d x + c\right ) - a\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 4 \, a \sin \left (d x + c\right ) - 2 \, a}{4 \, {\left (d \sin \left (d x + c\right ) - d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))*tan(d*x+c)^3,x, algorithm="fricas")

[Out]

-1/4*(4*a*cos(d*x + c)^2 + (a*sin(d*x + c) - a)*log(sin(d*x + c) + 1) - 5*(a*sin(d*x + c) - a)*log(-sin(d*x +
c) + 1) + 4*a*sin(d*x + c) - 2*a)/(d*sin(d*x + c) - d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a \left (\int \sin {\left (c + d x \right )} \tan ^{3}{\left (c + d x \right )}\, dx + \int \tan ^{3}{\left (c + d x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))*tan(d*x+c)**3,x)

[Out]

a*(Integral(sin(c + d*x)*tan(c + d*x)**3, x) + Integral(tan(c + d*x)**3, x))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 26228 vs. \(2 (66) = 132\).
time = 171.23, size = 26228, normalized size = 369.41 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))*tan(d*x+c)^3,x, algorithm="giac")

[Out]

1/4*(3*a*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*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1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(d*x)^2*tan(1/2*d*x)^6
*tan(1/2*c)^4*tan(c)^2 - 2*a*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)
^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(d*x)^2*tan(1/2*d*x)^6*tan(1/2*c)^4*tan(c)^2 - 24*a*log(2*(tan(
1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan
(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 -
2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(d*x)^2*tan(1/2*d*x)^5*tan(1/2*c)^5*tan(c)^2 + 24*a*
log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x
)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(
1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(d*x)^2*tan(1/2*d*x)^5*tan(1/2*c)^5*tan(c
)^2 - 16*a*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*ta
n(c) + 1)/(tan(c)^2 + 1))*t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- 16*a*tan(d*x)^2*tan(1/2*d*x)^5*tan(1/2*c)^5*tan(c)^2 - 2*a*tan(d*x
)^2*tan(1/2*d*x)^4*tan(1/2*c)^6*tan(c)^2 + 2*a*tan(1/2*d*x)^6*tan(1/2*c)^6*tan(c)^2 + 3*a*log(2*(tan(1/2*d*x)^
4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)
^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2
*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*t...

________________________________________________________________________________________

Mupad [B]
time = 6.47, size = 154, normalized size = 2.17 \begin {gather*} \frac {5\,a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )}{2\,d}-\frac {a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )}{2\,d}+\frac {3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-4\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+3\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )}-\frac {a\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^3*(a + a*sin(c + d*x)),x)

[Out]

(5*a*log(tan(c/2 + (d*x)/2) - 1))/(2*d) - (a*log(tan(c/2 + (d*x)/2) + 1))/(2*d) + (3*a*tan(c/2 + (d*x)/2) - 4*
a*tan(c/2 + (d*x)/2)^2 + 3*a*tan(c/2 + (d*x)/2)^3)/(d*(2*tan(c/2 + (d*x)/2)^2 - 2*tan(c/2 + (d*x)/2) - 2*tan(c
/2 + (d*x)/2)^3 + tan(c/2 + (d*x)/2)^4 + 1)) - (a*log(tan(c/2 + (d*x)/2)^2 + 1))/d

________________________________________________________________________________________